Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Macintosh Draw Contexts

A Macintosh draw context is a draw context associated with a Mac OS window. You specify a Mac OS window by providing a pointer to a window (of type CWindowPtr ) which defines the area into which QuickDraw 3D will draw images of rendered models. In addition, you can attach to a Macintosh draw context either a QuickDraw color graphics port (of type CGrafPort ) or a QuickDraw GX view port (of type gxViewPort ). Using this optional two-dimensional graphics library, you can achieve special effects such as clipping, dithering, and geometrical transforms of the image. At most one 2D graphics library can be associated with a Macintosh draw context at one time, and you are responsible for initializing the graphics library and performing any other required set-up.

QuickDraw 3D cannot use a two-dimensional graphics library unless the draw context is configured for double buffering and the active buffer is set to the back buffer. QuickDraw and QuickDraw GX effects are applied when the front buffer is updated from the back buffer. Figure 4 illustrates the three possibilities for drawing in a Macintosh draw context. You can use QuickDraw to set a clip region (middle possibility) and QuickDraw GX to set a clip shape (right possibility).

Figure 4 Using a two-dimensional graphics library in a Macintosh draw context


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |